<template>
	<view class="flex-center clear-flex u-m-r-24" @click="getAreacode">
		<view class="u-m-r-10">{{ areacodeObj.short }}</view>
		<view class="u-m-r-10">+{{ areacodeObj.code }}</view>
		<view class="clear-flex u-p-b-10">
			<image
			src="@/static/image/common/down.png"
			:style="{ width: '20rpx', height: '14rpx' }"
			mode="widthFix"></image>
		</view>
	</view>
</template>

<script>
	import areacode from '@/utils/areacode.js'
	export default {
		data() {
			// 初始化区域
			let areacodeObj = areacode.list[0];
			return {
				areacodeObj
			}
		},
		methods: {
			getAreacode() {
				uni.navigateTo({
					url: '/pages/other/areacode/areacode',
					events: {
						change: (e) => {
							this.$emit('change', e)
							this.areacodeObj = {...e}
						}
					},
					success: res => {
						res.eventChannel.emit('areacode-page')
					}
				})
			}
		}
	}
</script>

<style>
</style>
